var app = getApp();
Page({
  data:{
    article : {},
    mHidden:true,
    cm:0
  },
 
    onLoad:function(options){
        var self = this;
        
        app.com.http('article','POST',{id:options.aid,op:'article'},0,true,function(res){
          console.log(res);
            if (!res.data.errno) {
                self.setData({
                    article : res.data.data,
                });

                var WxParse = require('../../resource/wxParse/wxParse.js');
                WxParse.wxParse( 'article.content', 'html',  res.data.data.content, self, 0);

                wx.setNavigationBarTitle({
                  title:  res.data.data.title,
                });
            }
            if (res.data.data.cm=="过期"){
              console.log(11);
              wx.showModal({
                title: '提示',
                content: '该活动已过期',
              })
            }
            
        })

    },

    
    onReady:function(){
        var self = this;
        // 页面渲染完成

    },
    onShareAppMessage : function(){
        var self = this;
        return {
            title: self.data.article.title,
            path: '',
            imageUrl : self.data.article.img,
        }
    },
    
    

})